
package com.insigma.business.qrcode.soldier.dao;


import com.insigma.business.qrcode.common.annotation.Crypt;
import com.insigma.business.qrcode.soldier.dto.SoldierBasicInfoBSearcher;
import com.insigma.business.qrcode.soldier.entity.DataStatsCDO;
import com.insigma.business.qrcode.soldier.entity.SoldierBasicInfoDO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Crypt(decryptFields = {"idCardNo", "mobile", "residentAddress"})
public interface SoldierBasicInfoDao {

    
    List<SoldierBasicInfoDO> search(final SoldierBasicInfoBSearcher innerSearcher);

    
    SoldierBasicInfoDO get(final String id);

    
    Integer insert(final SoldierBasicInfoDO soldierBasicInfoDO);

    
    Integer update(final SoldierBasicInfoDO soldierBasicInfoDO);

    
    Integer delete(@Param("id") final String id,
                   @Param("modifierType") final String modifierType,
                   @Param("modifierId") final String modifierId);

    
    @Crypt(encryptParamIndex = {0})
    SoldierBasicInfoDO getByIdCardNo(String idCardNo);

    
    SoldierBasicInfoDO getBySoldierId(String soldierId);

    
    List<DataStatsCDO> listNation(final String adminAreaCode);

    List<DataStatsCDO> listGender(final String adminAreaCode);

    List<DataStatsCDO> listEducationLevel(final String adminAreaCode);

    List<DataStatsCDO> listMaritalStatus(final String adminAreaCode);

    List<DataStatsCDO> listPoliticalOutlook(final String adminAreaCode);

    List<DataStatsCDO> listHouseholdRegisterType(final String adminAreaCode);

    
    List<DataStatsCDO> countAreaPerson(@Param("adminAreaCode") String adminAreaCode, @Param("nextCodeLength") int nextCodeLength);


    List<SoldierBasicInfoDO> allSoldier();

    Integer countSoldier(@Param("adminAreaCode") String adminAreaCode, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<DataStatsCDO> listAgeRange(String adminAreaCode);

    @Crypt(encryptParamIndex = {0})
    SoldierBasicInfoDO getSoldierBasicInfoByCardAndName(@Param("idCardNo") String idCardNo, @Param("name") String name);

    List<SoldierBasicInfoDO> listSoldierBasicInfoByNameOfArea(@Param("condition") String condition, @Param("adminAreaCode") String adminAreaCode);

    
    List<SoldierBasicInfoDO> listByIdList(@Param("idList") final List<String> idList);

    @Crypt(encryptParamIndex = {0})
    List<SoldierBasicInfoDO> listByIdCardNoList(@Param("idCardNoList") final List<String> idCardNoList);

    List<DataStatsCDO> querySoldierQrSuccessResult(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel,
                                                   @Param("levelLength") int levelLength, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    int countQrSuccessByArea(@Param("areaLike") String areaLike, @Param("applyType") String applyType, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    int count(SoldierBasicInfoBSearcher soldierBasicInfoBSearcher);

    List<SoldierBasicInfoDO> listBySearcher(SoldierBasicInfoBSearcher soldierBasicInfoBSearcher);

    
    List<DataStatsCDO> queryAllSoldierResult(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel
            , @Param("levelLength") int levelLength, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    
    List<SoldierBasicInfoDO> searchPreferentialTreatment(SoldierBasicInfoBSearcher soldierBasicInfoBSearcher);

    List<Map<String, String>> queryAreaQrDetail(String areaLike);

    List<DataStatsCDO> queryAreaSoldierQrStats(@Param("areaLike") String areaLike, @Param("isQr") int isQr
            , @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<Map<String, Object>> querySoldierManualCheckDetail(@Param("areaLike") String areaLike
            , @Param("nextCodeLength") int nextCodeLength, @Param("padString") String padString
            , @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<SoldierBasicInfoDO> searchAreaSoldierShortList(SoldierBasicInfoBSearcher searcher);

    List<DataStatsCDO> querySoldierManualStats(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel
            , @Param("nextCodeLength") int nextCodeLength, @Param("type") String type
            , @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    Integer countRetiredSoldier(String areaLike);
    Integer countWorkAgeSoldier(String areaLike);

    Integer countSoldierByGender(@Param("type") String type, @Param("areaLike") String areaLike);

    
    List<DataStatsCDO> listAgeRangeByGender(@Param("areaLike") String areaLike, @Param("gender") String gender);


    List<DataStatsCDO> listEducationLevelByGender(@Param("areaLike") String areaLike, @Param("gender") String gender);

    @Crypt(encryptParamIndex = {0})
    Integer setSoldierDead(@Param("idCardNo") String idCardNo, @Param("info") String info);

    List<SoldierBasicInfoDO> listByNameAndAdminAreaCode(@Param("realName") String realName, @Param("adminAreaCodeLike") String adminAreaCodeLike);

    List<SoldierBasicInfoDO> searchAreaDifficultySoldierShortList(SoldierBasicInfoBSearcher searcher);

    List<SoldierBasicInfoDO> searchAreaUnemploymentSoldierShortList(SoldierBasicInfoBSearcher searcher);

    
    Integer countRealDifficultyByArea(String areaLike);

    
    Integer countRealUnemploymentByArea(String areaLike);

    List<DataStatsCDO> countSubAreaRealUnemploymentDistri(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel, @Param("levelLength") int levelLength);

    List<DataStatsCDO> countSubAgeRealUnemploymentDistri(String areaLike);

    List<SoldierBasicInfoDO> searchNewNotInTpAll(SoldierBasicInfoBSearcher innerSearcher);

    List<DataStatsCDO> countSubAreaLowSide(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel, @Param("levelLength") int levelLength);

    List<DataStatsCDO> countSubAreaExtremelyPoor(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel, @Param("levelLength") int levelLength);

    List<DataStatsCDO> countSubAreaSubsistenceAllowance(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel, @Param("levelLength") int levelLength);

    List<SoldierBasicInfoDO> allNullSoldier(String areaCode);

    @Crypt(encryptParamIndex = {0})
    void updateNewResidentAdminCode(@Param("idCardNo")String idCardNo, @Param("areaCode")String areaCode);

    
    Integer countSoldierType(@Param("areaLike")String areaLike, @Param("soldierTypes")List<String> soldierTypes);

    Integer countPartyMember(String areaLike);

    Integer countNotPartyMember(String areaLike);

    List<SoldierBasicInfoDO> listAllSameAdminAreaCode(String adminAreaCode);

    @Crypt(encryptParamIndex = {0})
    String getOriginAddress(String idCardNo);

    Integer realDelete(String id);

    @Crypt(encryptParamIndex = {0})
    String getAreaCodeByIdCardNo(String idCardNo);

    List<DataStatsCDO> listAgeRangeOfQrSuccess(String areaLike);

    @Crypt(encryptParamIndex = {0})
    int countWestLakePreTreatment(String idCardNo);

    List<DataStatsCDO> groupBySoldierType(String areaLike);

    List<DataStatsCDO> groupByLabels(String areaLike);

    Integer countSubsistenceAllowance(String areaLike);

    Integer countLowSide(String areaLike);

    Integer countExtremelyPoor(String areaLike);

    List<DataStatsCDO> listAgeRange2(@Param("areaLike") String areaLike);

    
    List<DataStatsCDO> listAgeRange3(@Param("areaLike") String areaLike, @Param("soldierType") String soldierType);

    List<SoldierBasicInfoDO> listProblemBirthday();

    Integer countPreTreatment();

    @Crypt(encryptParamIndex = {0})
    Integer isKeyPreTreatment(String idCardNo);

    SoldierBasicInfoDO getByMobile(String mobile);

    List<SoldierBasicInfoDO> listGetByBirthday(String month, String areaLike);

    @Crypt(encryptParamIndex = {0}, returnDecrypt = true)
    List<String> listExistedIdCardNo(@Param("idCardNoSet")List<String> idCardNoSet);

    List<String> listAllIdCardNo();

    Integer countPreTreatmentByArea(String adminAreaCode);

    List<DataStatsCDO> groupPreferentialTreatmentAreaMap(@Param("areaLike")String areaLike, @Param("nextLevel")int nextLevel, @Param("levelLength")int levelLength);

    Integer countRetireByAreaAndYear(@Param("adminAreaCode")String adminAreaCode, @Param("year")String year);

    Integer countEntryByAreaAndYear(@Param("adminAreaCode")String adminAreaCode, @Param("year")String year);

    List<DataStatsCDO> groupByEducationLevelOfTp(@Param("adminAreaCode")String adminAreaCode, @Param("tpType")String tpType);

    List<DataStatsCDO> groupAreaPersonOfTp(@Param("areaLike") String areaLike, @Param("nextLevel") int nextLevel,@Param("levelLength")  int levelLength, @Param("tpType") String tpType);

    List<String> listAllMobile(String adminAreaCode);

    List<SoldierBasicInfoDO> listBySoldierIdList(@Param("soldierIdList")List<String> soldierIdList);

    List<SoldierBasicInfoDO> listTestIdTable(String adminAreaCode);

    List<DataStatsCDO> groupByPreferentialTreatmentType(String adminAreaCode);

    Integer countPretreatmentOfSyfSoldier(String adminAreaCode);

    List<DataStatsCDO> groupPretreatmentOfSyfSoldier(@Param("areaLike")String areaLike, @Param("nextLevel")int nextLevel, @Param("levelLength")int levelLength);

    Integer countByAreaAndPretreatLike(@Param("adminAreaCode")String adminAreaCode, @Param("type")String type);

    List<DataStatsCDO> groupByPolitical(String adminAreaCode);

    List<SoldierBasicInfoDO> searchElderlySoldier(SoldierBasicInfoBSearcher searcher);

    List<DataStatsCDO> groupByPreferentialTreatmentTypeOfOrigin(String adminAreaCode);
}
